package com.gome.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_role")
public class Role implements Serializable {
    @TableId
    private int nId;
    private String ocRolebm;
    private String vcRolemc;
    private String vcMsxx;
    private String ocZt;
    private String ocCzy;
    private Date dtCzrq;
    private String ocYxbz;

    /** 此角色下的菜单 */
    private List<Menu> menus;

    /** 此角色下的菜单 */
    private List<User> users;
    public static Role valueOf(String strRole){
        return JSONObject.parseObject(strRole.replaceAll(" ", ""), Role.class);
    }
}
